/**
 * Project: complex.java
 * 
 * File Created at 2011-9-8
 * $Id$
 * 
 * Copyright 2008 Alibaba.com Croporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Alibaba Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Alibaba.com.
 */
package complex.java.serialize;

import java.io.IOException;
import java.io.ObjectStreamException;
import java.io.Serializable;
import java.util.List;

/**
 * 如果要观察java的serialize过程，可以开启四个注掉的方法 
 * 
 * @author ymkyve
 */
public class Order implements Serializable {
    /**
     * 
     */
    private static final long serialVersionUID = -8036299553513225686L;
    private String            orderId;
    private int               totalNumber;
    //private Route             route;
    List<Network>             networks;

//    public void writeObject(java.io.ObjectOutputStream out) throws IOException {
//        System.out.println("writeObject invoked");
//        out.writeInt(123);
//    }
//
//    public void readObject(java.io.ObjectInputStream in) throws IOException,
//            ClassNotFoundException {
//        System.out.println("readObject invoked");
//        totalNumber = in.readInt();
//    }
//
//    public Object writeReplace() throws ObjectStreamException {
//        System.out.println("writeReplace invoked");
//        return this;
//    }
//
//    public Object readResolve() throws ObjectStreamException {
//        System.out.println("readResolve invoked");
//        return this;
//    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public int getTotalNumber() {
        return totalNumber;
    }

    public void setTotalNumber(int totalNumber) {
        this.totalNumber = totalNumber;
    }

//    public Route getRoute() {
//        return route;
//    }
//
//    public void setRoute(Route route) {
//        this.route = route;
//    }

    public List<Network> getNetworks() {
        return networks;
    }

    public void setNetworks(List<Network> networks) {
        this.networks = networks;
    }

	@Override
	public String toString() {
		return "Order [orderId=" + orderId + ", totalNumber=" + totalNumber
				+ ", networks=" + networks + "]";
	}

    
}
